package net.asfun.jvalog.entity;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Blob;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class File implements Model, Serializable {

	private static final long serialVersionUID = -3365519130579168667L;
	
	public static final int IMAGE_TYPE = 0;
	public static final int FLASH_TYPE = 1;
	public static final int AUDIO_TYPE = 2;
	public static final int VIDEO_TYPE = 3;
	public static final int PACK_TYPE = 4;
	public static final int OTHER_TYPE = 5;
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	@Persistent
	private String name;
	@Persistent
	private String mime;
	@Persistent
	private Blob bytes;
	@Persistent
	private int type;
	@Persistent
	private Date date;
	
	public Key getKey() {
		return key;
	}
	public void setKey(Key key) {
		this.key = key;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getMime() {
		return mime;
	}
	public void setMime(String mime) {
		this.mime = mime;
	}
	public Blob getBytes() {
		return bytes;
	}
	public void setBytes(Blob bytes) {
		this.bytes = bytes;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
}
